﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListPhim.ascx.cs" Inherits="HDTuyenChon.WebControls.ListPhim" %>
<h2 class="blockTitle">
    <asp:Label ID="lblTitle" runat="server" Text=""></asp:Label>
</h2>
<asp:ListView ID="listPhim" runat="server">
    <LayoutTemplate>
        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
    </LayoutTemplate>
    <ItemTemplate>
        <div class="blockItems">
            <a href="#" title='<%# Eval("Tua_EN")%>'>
                <img alt='<%# Eval("Tua_EN")%>' src="Images/<%# Eval("Hinh_Anh").ToString().Trim() %>.jpg"
                    width="140" height="190" /></a>
            <div class="meta">
                <h4>
                    <a href="#" title='<%# Eval("Tua_VN")%>'>
                        <%# Eval("Tua_VN")%></a>
                </h4>
                
            </div>
            <!-- End .meta -->
           
                <table style="padding: 0px; margin: 0px; width: 140px;">
            <tr>
            <td style="text-align: left"><a href="#">
                <img alt="download" src="../Images/web/icon_download.jpg"  width="20px" height="20px"/></a>
                 </td>
            <td style="text-align: right">
                <a href="#" style="color: #000000">Chọn phim</a>
            </tr>
            </table>
            <asp:HiddenField ID="hdMaPhim" runat="server" Value='<%# Eval("MS_Phim")%>' />
            <%--<table style="padding: 0px; margin: 0px; width: 140px;">
            <tr>
            <td style="text-align: left"><%# Eval("LoaiHD")%></td>
            <td style="text-align: right"><a href="#" style="color: #000000">Download</a> </td>
            </tr>
            </table> --%>
        </div>
    </ItemTemplate>
    <EmptyDataTemplate>
        <div>
            Khong tim thay san pham trong catology nay
        </div>
    </EmptyDataTemplate>
</asp:ListView>
<div class="datapager">
    <asp:DataPager ID="DataPager1" runat="server" PagedControlID="listPhim" 
        PageSize="16" onprerender="DataPager1_PreRender">
        <%--<Fields>
            <asp:NextPreviousPagerField ShowFirstPageButton="True" ShowNextPageButton="False" />
            <asp:NumericPagerField />
            <asp:NextPreviousPagerField ShowLastPageButton="True" ShowPreviousPageButton="False" />
        </Fields>--%>
         <Fields>                                                             
                <asp:NextPreviousPagerField ButtonType ="Button" ShowFirstPageButton="True" ShowPreviousPageButton="True" ShowNextPageButton="True" ShowLastPageButton="True" />
               <asp:TemplatePagerField>
                    <PagerTemplate>
                    <br />
                        Page
                        <asp:Label runat="server" ID="lbCurrentPage" 
                          Text="<%# Container.TotalRowCount>0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %>" />
                        of
                        <asp:Label runat="server" ID="lbTotalPages" 
                          Text="<%# Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %>" />
                        (Total:
                        <asp:Label runat="server" ID="lbTotalItems" 
                          Text="<%# Container.TotalRowCount%>" />
                        records)
                    
                        <asp:TextBox ID="tbPageNumber" runat="server" Width="30px" onKeyUp = "value = value.replace(/[^0-9]/g,'')"
                        Text="<%# Container.TotalRowCount>0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %>" ></asp:TextBox>
                        <asp:Button ID="btnGoTo" runat="server" Text="GoTo" />                
                    </PagerTemplate>
                </asp:TemplatePagerField>
              <%--<asp:TemplatePagerField OnPagerCommand="TemplateNextPrevious_OnPagerCommand">
                    <PagerTemplate>                                                                                                                 
                        <asp:LinkButton ID="lbtnFirst" runat="server" CommandName="First" 
                        Text="First" Visible='<%# Container.StartRowIndex > 0 %>' />

                        <asp:LinkButton ID="lbtnPrevious" runat="server" CommandName="Previous" 
                        Text='<%# (Container.StartRowIndex - Container.PageSize + 1) + " - " + (Container.StartRowIndex) %>'
                        Visible='<%# Container.StartRowIndex > 0 %>' />
                        
                        <asp:Label ID="lbtnCurrent" runat="server"
                        Text='<%# (Container.StartRowIndex + 1) + "-" + (Container.StartRowIndex + Container.PageSize > Container.TotalRowCount ? Container.TotalRowCount : Container.StartRowIndex + Container.PageSize) %>' />
                       
                        <asp:LinkButton ID="lbtnNext" runat="server" CommandName="Next"
                        Text='<%# (Container.StartRowIndex + Container.PageSize + 1) + " - " + (Container.StartRowIndex + Container.PageSize*2 > Container.TotalRowCount ? Container.TotalRowCount : Container.StartRowIndex + Container.PageSize*2) %>' 
                        Visible='<%# (Container.StartRowIndex + Container.PageSize) < Container.TotalRowCount %>' />
 
                        <asp:LinkButton ID="lbtnLast" runat="server" CommandName="Last" 
                        Text="Last" Visible='<%# (Container.StartRowIndex + Container.PageSize) < Container.TotalRowCount %>' />                        
                    </PagerTemplate>
                </asp:TemplatePagerField>--%>
                
               <%-- <asp:TemplatePagerField OnPagerCommand = "TemplateGoTo_OnPagerCommand">            
                    <PagerTemplate>
                        <br /><br />
                        <asp:TextBox ID="tbPageNumber" runat="server" Width="30px" onKeyUp = "value = value.replace(/[^0-9]/g,'')"
                        Text="<%# Container.TotalRowCount>0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %>" ></asp:TextBox>
                        <asp:Button ID="btnGoTo" runat="server" Text="GoTo" />
                    </PagerTemplate>            
                </asp:TemplatePagerField>--%>
            </Fields>
    </asp:DataPager>
</div>
